package oop3.pet;

import java.util.Scanner;

public class PetTest5 {

	public static void main(String[] args) {
		// Pet p = new Cat("加菲", 100, 89, "波斯猫", "公");
		// Pet p = new Crocodile("加菲", 100, 89, "波斯猫");
		// System.out.println(p instanceof Object);
		PetMarket mk = new PetMarket();
		Scanner in = new Scanner(System.in);
		System.out.println("花多少钱？");
		int money = in.nextInt();
		Pet p = mk.sell(money);
		if (p == null) {
			System.out.println("什么都买不到，空手回来了");
			return;
		}
		p.show();
		p.cry();
		// 1:
		if (p instanceof Cat) {
			((Cat) p).catchMouse("金毛鼠");
			// p.catchMouse("sss");
			// 2:
			Cat cat = (Cat) p;
			cat.catchMouse("米琪");
		} else {
			System.out.println("不是一只猫");
		}
	}
}
